/**
 *
 */
package com.wedroid.r2d2.support.sync;

/**
 * @author lute
 */
public enum SyncSelector {

    /** 无事件 */
    NONE(0),

    /** 有新消息 */
    NEW(2),

    /** 未知 */
    UNKNOWN(3),

    /** 通讯录有更新 */
    CONTACT_UPDATE(4),

    /** 在微信客户端进行了操作 */
    OPERATION(7);

    private int selector;

    /**
     * @param selector
     */
    private SyncSelector(int selector) {
        this.selector = selector;
    }

    /**
     * @param selector
     * @return
     */
    public static SyncSelector selectorOf(int selector) {
        for (SyncSelector messageSelector : SyncSelector.values()) {
            if (messageSelector.selector == selector) {
                return messageSelector;
            }
        }
        return SyncSelector.UNKNOWN;
    }

    /**
     * @return the selector
     */
    public int getSelector() {
        return selector;
    }

}
